<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateStaffDormHistoriesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('staff_dorm_histories', function (Blueprint $table) {
            $table->unsignedInteger('staff_id');
            $table->unsignedInteger('dorm_id');
            $table->unsignedSmallInteger('year');
            $table->unsignedTinyInteger('month');
            $table->unsignedTinyInteger('days');
            $table->date('from_date');
            $table->date('to_date');
            $table->boolean('archived')->default(false)->comment('0 未归档 1已经归档 归档后不能删除');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('staff_dorm_histories');
    }
}
